package com.ubaer.zsycz.inject.modules;

import android.app.Activity;
import android.content.Context;
import android.support.v4.app.Fragment;

import com.ubaer.zsycz.inject.scope.PerFragment;

import dagger.Module;
import dagger.Provides;

/**
 * author：lsw
 */
@Module
public class FragmentModule {
    private Fragment mFragment;

    public FragmentModule(Fragment mFragment) {
        this.mFragment = mFragment;
    }

    @Provides
    @PerFragment
    public Activity provideActivity() {
        return mFragment.getActivity();
    }

    @Provides
    @PerFragment
    public Context provideContext() {
        return provideActivity();
    }
}
